#include <iostream>
#include <iomanip>
using namespace std;

void funcTestLargeNumber() {

    double largeNumber = 123456789.123456;

    // 设置输出为科学记数法，并设置精度为6
    std::cout << "Using scientific notation:\n"
        << std::scientific << std::setprecision(6)
        << largeNumber << "\n";

    // 或者如果你想让程序根据数值大小自动选择最合适的表示法（包括科学记数法）
    std::cout << "Using default floating-point notation:\n"
        << std::defaultfloat << std::setprecision(6)
        << largeNumber << "\n";

}

int main() {
    funcTestLargeNumber();
    return 0;
    int total{ 0 };
    int gradeCounter{ 0 };
    do {
        cout << "endter grade or -1 to quit: ";
        int grade;
        cin >> grade;
        if (grade != -1) {
            total = total + grade;
            gradeCounter = gradeCounter + 1;
        }
        else {
            break;
        }
    } while (true);
    if (gradeCounter != 0) {
        double average{ static_cast<double>(total / gradeCounter) };
        cout << "\nTotal of the " << gradeCounter << " grades entered is " << total;
        cout << setprecision(2) << fixed;
        cout << "\nClass average is " << average << "\n";
    }
    else {
        cout << "No grades were enetered!\n";
    }
    return 0;
}